/**
 */
package com.dingpeikeji.quickdeer.core.modules.cupons.dao;

import java.util.List;

import com.dingpeikeji.quickdeer.core.common.persistence.CrudDao;
import com.dingpeikeji.quickdeer.core.common.persistence.annotation.MyBatisDao;
import com.dingpeikeji.quickdeer.core.modules.cupons.entity.CuponsInfo;

/**
 * 优惠券定义DAO接口
 */
@MyBatisDao
public interface TCuponsDao extends CrudDao<CuponsInfo> {
	
	//获取优惠券领取人信息
	public List<CuponsInfo> getPickInfo(String cuponsId);
	
	//获取优惠券已使用人信息
	public List<CuponsInfo> getUseInfo(String cuponsId);
	
	//更新优惠券信息包括使失效
	public Integer updateCupons(CuponsInfo cuponsInfo);
	
	//新建优惠券
	public Integer insertCupons(CuponsInfo cuponsInfo);
	
	//获取我的优惠券
	public List<CuponsInfo> getMyCupons(String userId);
	
	// 注册得注册优惠券
	public Integer registCupons(CuponsInfo cuponsInfo);
	
	// 根据id获得优惠券信息
	public CuponsInfo getCuponsById(String id);
	
	//更新注册优惠券库存
	public Integer updateStock(String id,String stock);

	public Integer useCupon(CuponsInfo cuponsInfo);

	public CuponsInfo getRecordByOrderId(String orderId);
	
	public CuponsInfo getRecordBySid(String sid);
	
	public CuponsInfo getCuponsByRecordId(String recordId);
}
